package com.xuecheng.comment.agent;


import com.xuecheng.api.content.model.dto.CoursePubDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 *  Feign远程调用 内容管理
 */
@FeignClient(value = XcFeignServiceNameList.XC_CONTENT_SERVICE)
public interface CoursePubApiAgent {

    String SERVICE_CONTEXT_PRE = "/content";

    /**
     * 根据课程发布id 获取课程发布对象信息
     * @param coursePubId
     * @return
     */
    @GetMapping(SERVICE_CONTEXT_PRE + "/l/coursePub/{coursePubId}")
    RestResponse<CoursePubDTO> getCoursePubById(@PathVariable(value = "coursePubId") Long coursePubId);


    @GetMapping(SERVICE_CONTEXT_PRE + "/l/coursePubByCompanyId/{companyId}")
    RestResponse<List<CoursePubDTO>>getCoursePubByCompanyId(@PathVariable(value = "companyId")Long companyId);
}
